alien_0={"color": "green", "points": 5}
alien_1={"color": "yellow", "points": 10}
alien_2={"color": "red", "points": 15}
aliens = [alien_0, alien_1, alien_2]
for alien in aliens:
	print(alien)
aliens = []
for alien_number in range(0,30):
	new_alien = {"color": "green", "points": 5, "speed": "slow"}
	aliens.append(new_alien)
for alien in aliens[:5]:
	print(alien)
print("......")
print("total number of aliens is " + str(len(aliens)))
aliens = []
for aliens_number in range(30):
	new_alien = {"color": "green", "points": 5, "speed": "slow"}
	aliens.append(new_alien)
for alien in aliens[:5]:
	if alien["color"] == "green":
		alien["color"] = "yellow"
		alien["points"] = 10
		alien["speed"] = "medium"
for alien in aliens[:6]:
	print(alien)
print("......")
for alien in aliens[3:10]:
	if alien["color"] == "green":
		alien["color"] = "yellow"
		alien["points"] = 10
		alien["speed"] = "medium"
	else:
		alien["color"] = "red"
		alien["points"] = 15
		alien["speed"] = "fast"
for alien in aliens[:12]:
	print(alien)
print("......")
pizza = {
    "crust": "thick",
    "toppings":["mushrooms", "extra cheese"]
    }
print("you ordered a " + pizza["crust"] + "-crust pizza " +
    "with the following toppings: ")
for topping in pizza["toppings"]:
	print("\t" + topping)
#for 能遍历任何一种元素，但是在遍历的时候一定要统一？
favourite_languages = {
    "jen": ["python", "ruby"],
    "sarah": "c",
    "edward": ["ruby", "go"],
    "phil": ["python", "haskell"],
    }
for name, languages in favourite_languages.items():
	if len(languages) > 1:
	    print("\n" + name.title() + "'s favourite languages are:")
	    for language in languages:
		    print("\t" + language.title())
	else:
	    print("\n" + name.title() + "'s favourite languages is:")
	    for language in languages:
		    print("\t" + language.title())
users = {
    "aeinstein": {
        "first": "albert",
        "last": "einstein",
        "location": "princeton",
        },
    "mcurie": {
        "first": "marie",
        "last": "curie",
        "location": "paris",
        },
    }
for username, user_info in users.items():
	print("\nUsername: " + username)
	full_name = user_info["first"] + " " + user_info["last"]
	location = user_info["location"]
	print("\tFull name: " + full_name.title())
	print("\tLocation: " + location.title())
    
    

